Add test coverage for compiled regex patterns in pytest.raises()#14026
Conversation
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Hey @vicky-dx, thank you for working on pytest. I think it wasn't actually tested the coverage metric would have gone up. How did you determine it wasn't covered ?
|
I think the coverage is coming from tests with pytest/testing/python/raises_group.py Lines 1200 to 1210 in 980bb5c but that code is not doing end-to-end testing with compiled regexes, so seems fair enough to add tests that do it. FTR I double-checked and |
|
I think @vicky-dx might have meant "test coverage" in the (more loose) sense of the term, not in the sense of "number goes up". Seems sensible to me! |
5d5db60 to
c411c2b
Compare
Summary
This PR adds test coverage for using compiled regex patterns (
re.Patternobjects) with thematchparameter inpytest.raises(). While this functionality already works, it wasn't explicitly tested.Changes
test_raises_match_compiled_regex()intesting/python/raises.pyre.IGNORECASE)Checklist
changelogfolder (will add after PR number is assigned)AUTHORSin alphabetical order.Notes
This is a test coverage improvement that ensures the existing functionality for compiled regex patterns remains stable in future releases.